package com.framework;

import com.ulisesbocchio.jasyptspringboot.environment.StandardEncryptableEnvironment;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

@SpringBootApplication
@EnableDiscoveryClient
public class SysFileApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext context = new SpringApplicationBuilder()
                .environment(new StandardEncryptableEnvironment())
                .sources(SysFileApplication.class).run(args);
        Logger logger = LoggerFactory.getLogger( SysFileApplication.class );
        Environment environment = context.getBean(Environment.class);
        String port = environment.getProperty("local.server.port");
        logger.info( "--------------- {} is success! port: {}---------------", SysFileApplication.class.getSimpleName(), port);
    }
}
